#pragma once

#include "Core/Window.h"
#include "Renderer/GraphicsContext.h"
struct GLFWwindow;
/*
 * 初始化create的时候传入宽高
 * m_Window = glfwCreateWindow
 * 在windows窗口里绑定回调函数
 * */
namespace Hazel {
    class WindowsWindow : public Window{
    public:
        WindowsWindow(const WindowProps& props);
        virtual ~WindowsWindow();

        void OnUpdate()override;

        inline unsigned int GetWidth() const override{return m_Data.Width;}
        inline unsigned int GetHeight() const override{return m_Data.Height;}

        inline void SetEventCallback(const EventCallbackFn& callback) override{m_Data.EventCallback = callback;}
        void SetVSync(bool enabled) override;
        bool IsVSync()const override;

        GLFWwindow* GetNativeWindow() {
            return m_Window;
        }

        void GetPixelSize(uint32_t& width, uint32_t& height) const override;
    private:
        virtual void Init(const WindowProps& props);
        virtual void Shutdown();

    private:
        GLFWwindow* m_Window;
        Ref<GraphicsContext> m_Context;
        struct WindowData{
            std::string Title;
            unsigned int Width,Height;
            bool VSync;

            EventCallbackFn EventCallback;
        };

        WindowData m_Data;

    };
}
















